package com.sqly.doc.menu.jsjb;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.IdRes;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioGroup;
import android.widget.TextView;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ihidea.multilinechooselib.MultiLineChooseLayout;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.sqly.doc.R;
import com.sqly.doc.base.MyBaseActivity;
import com.sqly.doc.menu.camera.CameraChoose;
import com.sqly.doc.menu.fjh.fjhsf;
import com.sqly.doc.menu.gxy.gxy;
import com.sqly.doc.pojo.JsbSf;
import com.sqly.doc.pojo.JuMin;
import com.sqly.doc.pojo.RetMsg;
import com.sqly.doc.pojo.Selected;
import com.sqly.doc.user.choose_user;
import com.sqly.doc.util.BinderPojo;
import com.sqly.doc.util.BinderUtil;
import com.sqly.doc.util.CreateBitmap;
import com.sqly.doc.util.DateConvert;
import com.sqly.doc.util.HttpUrl;
import com.sqly.doc.util.MyToastUtil;
import com.sqly.doc.util.NetWorkUtils;
import com.sqly.doc.util.SharedPreferencesUtils;
import com.sqly.doc.util.SweetAlertDialogUtil;
import com.sqly.doc.util.Url;
import com.sqly.doc.util.UserClient;
import com.sqly.doc.util.WriteActivity;
import com.sqly.doc.view.CustomDatePicker;
import com.sqly.doc.view.StringUtils;

import java.io.File;
import java.io.FileNotFoundException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Locale;

//import cn.pedant.SweetAlert.SweetAlertDialog;
import com.cazaea.sweetalert.SweetAlertDialog;

import cz.msebera.android.httpclient.Header;

/**
 * Created by Administrator on 2017/11/22 0022.
 */

public class jsjb_sfjl extends MyBaseActivity{

    //标题
    TextView title, uname;
    LinearLayout back;

    @BinderPojo(value = R.id.SFJLH, name = "SFJLH", pojoProperty = true)
    private TextView SFJLH;

    @BinderPojo(value = R.id.XINGMING, name = "XINGMING", pojoProperty = true)
    private TextView XINGMING;
    @BinderPojo(value = R.id.SFRQ, name = "SFRQ", pojoProperty = true)
    private TextView SFRQ;

    @BinderPojo(value = R.id.SWRQ, name = "SWRQ", pojoProperty = true)
    private TextView SWRQ;

    @BinderPojo(value = R.id.ZZQT, name = "ZZQT", pojoProperty = true)
    private EditText ZZQT;

    @BinderPojo(value = R.id.QDZS, name = "QDZS", pojoProperty = true)
    private EditText QDZS;

    @BinderPojo(value = R.id.ZHAOSHI, name = "ZHAOSHI", pojoProperty = true)
    private EditText ZHAOSHI;

    @BinderPojo(value = R.id.ZHAOHUO, name = "ZHAOHUO", pojoProperty = true)
    private EditText ZHAOHUO;

    @BinderPojo(value = R.id.QTWHXW, name = "QTWHXW", pojoProperty = true)
    private EditText QTWHXW;//其他危害性行为

    @BinderPojo(value = R.id.ZISHANG, name = "ZISHANG", pojoProperty = true)
    private EditText ZISHANG;

    @BinderPojo(value = R.id.ZISHAWS, name = "ZISHAWS", pojoProperty = true)
    private EditText ZISHAWS;

    @BinderPojo(value = R.id.MCCYRQ, name = "MCCYRQ", pojoProperty = true)
    private TextView MCCYRQ;



    @BinderPojo(value = R.id.YWMC1, name = "YWMC1", pojoProperty = true)
    private EditText YWMC1;
    @BinderPojo(value = R.id.YWYF1, name = "YWYF1", pojoProperty = true)
    private EditText YWYF1;//目前用药情况-用法1
    @BinderPojo(value = R.id.YWYL1, name = "YWYL1", pojoProperty = true)
    private EditText YWYL1;//目前用药情况-用量1
    @BinderPojo(value = R.id.YWDW1, name = "YWDW1", pojoProperty = true)
    private EditText YWDW1;//目前用药情况-单位1

    @BinderPojo(value = R.id.YWMC2, name = "YWMC2", pojoProperty = true)
    private EditText YWMC2;
    @BinderPojo(value = R.id.YWYF2, name = "YWYF2", pojoProperty = true)
    private EditText YWYF2;//目前用药情况-用法1
    @BinderPojo(value = R.id.YWYL2, name = "YWYL2", pojoProperty = true)
    private EditText YWYL2;//目前用药情况-用量1
    @BinderPojo(value = R.id.YWDW2, name = "YWDW2", pojoProperty = true)
    private EditText YWDW2;//目前用药情况-单位1


    @BinderPojo(value = R.id.YWMC3, name = "YWMC3", pojoProperty = true)
    private EditText YWMC3;
    @BinderPojo(value = R.id.YWYF3, name = "YWYF3", pojoProperty = true)
    private EditText YWYF3;//目前用药情况-用法1
    @BinderPojo(value = R.id.YWYL3, name = "YWYL3", pojoProperty = true)
    private EditText YWYL3;//目前用药情况-用量1
    @BinderPojo(value = R.id.YWDW3, name = "YWDW3", pojoProperty = true)
    private EditText YWDW3;//目前用药情况-单位1

    @BinderPojo(value = R.id.YWBLFYY, name = "YWBLFYY", pojoProperty = true)
    private EditText YWBLFYY;

    @BinderPojo(value = R.id.KFCSQT, name = "KFCSQT", pojoProperty = true)
    private EditText KFCSQT;


    @BinderPojo(value = R.id.SLRXM1, name = "SLRXM1", pojoProperty = true)
    private EditText SLRXM1;//公安/社区受理人姓名
    @BinderPojo(value = R.id.SLRXM2, name = "SLRXM2", pojoProperty = true)
    private EditText SLRXM2;//公安/社区受理人姓名
    @BinderPojo(value = R.id.SLRDH1, name = "SLRDH1", pojoProperty = true)
    private EditText SLRDH1;//公安/社区受理人电话
    @BinderPojo(value = R.id.SLRDH2, name = "SLRDH2", pojoProperty = true)
    private EditText SLRDH2;//公安/社区受理人电话


    @BinderPojo(value = R.id.ZZYY, name = "ZZYY", pojoProperty = true)
    private EditText ZZYY;//转诊原因

    @BinderPojo(value = R.id.ZZJGJKB, name = "ZZJGJKB", pojoProperty = true)
    private EditText ZZJGJKB;//转诊机构及科室:

    @BinderPojo(value = R.id.ZZLXR, name = "ZZLXR", pojoProperty = true)
    private EditText ZZLXR;//转诊联系人

    @BinderPojo(value = R.id.ZZLXFS, name = "ZZLXFS", pojoProperty = true)
    private EditText ZZLXFS;//转诊联系方式


    @BinderPojo(value = R.id.JSKYSXM, name = "JSKYSXM", pojoProperty = true)
    private EditText JSKYSXM;//精神专科医师姓名

    @BinderPojo(value = R.id.JSKYSDH, name = "JSKYSDH", pojoProperty = true)
    private EditText JSKYSDH;//精神专科医师电话

    @BinderPojo(value = R.id.CZJG, name = "CZJG", pojoProperty = true)
    private EditText CZJG;//精神专科医师处置结果


    @BinderPojo(value = R.id.TZYWMC1, name = "TZYWMC1", pojoProperty = true)
    private EditText TZYWMC1;
    @BinderPojo(value = R.id.TZYWYF1, name = "TZYWYF1", pojoProperty = true)
    private EditText TZYWYF1;//目前用药情况-用法1
    @BinderPojo(value = R.id.TZYWYL1, name = "TZYWYL1", pojoProperty = true)
    private EditText TZYWYL1;//目前用药情况-用量1
    @BinderPojo(value = R.id.TZYWDW1, name = "TZYWDW1", pojoProperty = true)
    private EditText TZYWDW1;//目前用药情况-单位1

    @BinderPojo(value = R.id.TZYWMC2, name = "TZYWMC2", pojoProperty = true)
    private EditText TZYWMC2;
    @BinderPojo(value = R.id.TZYWYF2, name = "TZYWYF2", pojoProperty = true)
    private EditText TZYWYF2;//目前用药情况-用法1
    @BinderPojo(value = R.id.TZYWYL2, name = "TZYWYL2", pojoProperty = true)
    private EditText TZYWYL2;//目前用药情况-用量1
    @BinderPojo(value = R.id.TZYWDW2, name = "TZYWDW2", pojoProperty = true)
    private EditText TZYWDW2;//目前用药情况-单位1


    @BinderPojo(value = R.id.TZYWMC3, name = "TZYWMC3", pojoProperty = true)
    private EditText TZYWMC3;
    @BinderPojo(value = R.id.TZYWYF3, name = "TZYWYF3", pojoProperty = true)
    private EditText TZYWYF3;//目前用药情况-用法1
    @BinderPojo(value = R.id.TZYWYL3, name = "TZYWYL3", pojoProperty = true)
    private EditText TZYWYL3;//目前用药情况-用量1
    @BinderPojo(value = R.id.TZYWDW3, name = "TZYWDW3", pojoProperty = true)
    private EditText TZYWDW3;//目前用药情况-单位1

    @BinderPojo(value = R.id.XCSFRQ, name = "XCSFRQ", pojoProperty = true)
    private TextView XCSFRQ;


    RadioGroup SFFS,SFYY,SWYY,SWYYQT,WXX,ZZL,
            SMQK,YSQK,
            GRSHLL,JWLD,SCLDGZ,XXNL,SHRJJW,
            GSQK,ZYQK,SYSJC,
            FYYCX,ZLXG,SFFL,
            TZLXBM,
            SFZZ,ZZJG,LXJSKYS,YWBLFY,TZYWPL1,TZYWPL2,TZYWPL3,YWPL1,YWPL2,YWPL3;
    MultiLineChooseLayout KFCS,ZHENGZHUANG;//目前症状

    private List<String> mqzzdata = new ArrayList<>();
    private List<String> kfcsdata = new ArrayList<>();

    Context con = jsjb_sfjl.this;
    private CustomDatePicker customDatePicker;
    JsbSf obj;
    boolean isadd=false;//是否是新添加
    String url="",JKDAH="";
    ImageView sfysqm, brqm, xcqm;
    String sfysqmpic = "", brqmpic = "",xcqmpic ="";
    List<Selected> slist = new ArrayList<>();
    JuMin j;

    ImageView xcpaizhao;
    TextView pz_record_id,jmqm_record_id, ysqm_record_id;
    boolean pzChange = false;

    @Override
    protected void initUI() {
        setContentView(R.layout.jsb_sfjl);
        BinderUtil.exeFindById(jsjb_sfjl.this);
        if (NetWorkUtils.isNetworkConnected(con)) {
            if (getIntent().getStringExtra("type").equals("edit")) {
                obj = (JsbSf) getIntent().getExtras().getSerializable("b");
                init(obj);
                if(!StringUtils.isEmpty(obj.getImg())){
                    //ImageLoader.getInstance().displayImage(Url.img_url()+obj.getImg(),brqm);
                    ImageLoader.getInstance().displayImage(Url.newStaticurl(SharedPreferencesUtils.getParam(con, "token", "").toString(), "2" ,obj.getImg()),brqm);
                }
                if(!StringUtils.isEmpty(obj.getImg1())){
                    //ImageLoader.getInstance().displayImage(Url.img_url()+obj.getImg1(),sfysqm);
                    ImageLoader.getInstance().displayImage(Url.newStaticurl(SharedPreferencesUtils.getParam(con, "token", "").toString(), "2" ,obj.getImg1()),sfysqm);
                }
                if(!StringUtils.isEmpty(obj.getImg2())){
                    //ImageLoader.getInstance().displayImage(Url.img_url()+obj.getImg2(),xcqm);
                    ImageLoader.getInstance().displayImage(Url.newStaticurl(SharedPreferencesUtils.getParam(con, "token", "").toString(), "2" ,obj.getImg2()),xcqm);
                }
                XINGMING.setClickable(false);
            }else {
                obj = new JsbSf();
                init(obj);
            }
        }
    }

    private void init(final JsbSf obj){
        initEditText(obj);
        initRadioGroup(obj);
        initMultiLineChooseLayout();
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (data == null) {

        } else if (requestCode == 1) {
            j = (JuMin) data.getExtras().getSerializable("j");
            getObject();
        }else if (requestCode == 8) {
            String record_id = (String) data.getExtras().getString("record_id");
            ysqm_record_id.setText(record_id);
            byte[] bis = data.getByteArrayExtra("bitmap");
            Bitmap bmp = BitmapFactory.decodeByteArray(bis, 0, bis.length);
            Bitmap bb = CreateBitmap.zoomImg(bmp, 1, 1);
            sfysqm.setImageBitmap(bb);
            sfysqmpic = CreateBitmap.saveMyBitmap(bb);
        }else if (requestCode == 9) {
            String record_id = (String) data.getExtras().getString("record_id");
            jmqm_record_id.setText(record_id);
            byte[] bis = data.getByteArrayExtra("bitmap");
            Bitmap bmp = BitmapFactory.decodeByteArray(bis, 0, bis.length);
            Bitmap bb = CreateBitmap.zoomImg(bmp, 1, 1);
            brqm.setImageBitmap(bb);
            brqmpic = CreateBitmap.saveMyBitmap(bb);
        }else if(requestCode == 119){
            String img_record_id = (String) data.getExtras().getString("img_record_id");
            pz_record_id.setText(img_record_id);
            pzChange = true;
            byte[] bis = data.getByteArrayExtra("bitmap");
            Bitmap bmp = BitmapFactory.decodeByteArray(bis, 0, bis.length);
            Bitmap bb = CreateBitmap.zoomImg(bmp, 1, 1);
            xcqm.setImageBitmap(bb);
        }
    }

    public void getObject() {
        RequestParams ps = new RequestParams();
        ps.add("token", SharedPreferencesUtils.getParam(con, "token", "").toString());
        ps.add("type", "2");
        ps.add("CARDNUM", j.getCARDNUM());
        UserClient.get(HttpUrl.GetJsbSfGrjbxx, ps, new AsyncHttpResponseHandler() {
            @Override
            public void onSuccess(int statusCode, Header[] headers, byte[] response) {
                String content = new String(response);
                RetMsg ret = JSON.parseObject(content, RetMsg.class);
                if (ret.getCode().equals("200")) {
                    JSONObject j = JSON.parseObject(ret.getRd());
                    obj = new JsbSf();
                    init(obj);
                    obj.setJKDAH(j.getString("JKDAH"));
                    obj.setXINGMING(j.getString("XINGMING"));
                    obj.setCARDNUM(j.getString("CARDNUM"));
                    JKDAH = j.getString("JKDAH");
                    XINGMING.setText(j.getString("XINGMING"));

                    isadd = true;
                } else {
                    SweetAlertDialogUtil.ErrorDialogNoFinish(con, "错误提示", ret.getInfo(), "确定");
                }

            }
            @Override
            public void onFinish() {
                super.onFinish();
            }

            @Override
            public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {

                isadd = true;
                obj = new JsbSf();
                init(obj);
            }
        });
    }

    private void initEditText(final JsbSf obj){
        //运行时生成activity中所有控件的findViewById方法
        //BinderUtil.exeFindById(jsjb_sfjl.this);
        BinderUtil.initData(jsjb_sfjl.this, obj);
        //医生签名
        sfysqm = (ImageView) findViewById(R.id.sfysqm);
        if (obj != null && !StringUtils.isEmpty(obj.getSfysqm())) {
            sfysqmpic = obj.getSfysqm();
            sfysqm.setImageBitmap(BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + "/" + sfysqmpic + ".jpg"));
        }
        sfysqm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivityForResult(new Intent(con, WriteActivity.class)
                        .putExtra("cardnum", obj.getCARDNUM())
                        .putExtra("tabId", null==obj.getSFJLH()||"".equals(obj.getSFJLH()) ? "noid" : obj.getSFJLH())
                        .putExtra("tabType", "zxjsbsf")
                        .putExtra("imageType", "img1")
                        .putExtra("class", "jsjb_sfjl.class"), 8);
            }
        });
        //本人签名
        brqm = (ImageView) findViewById(R.id.brqm);
        if (obj != null && !StringUtils.isEmpty(obj.getBrqm())) {
            brqmpic = obj.getBrqm();
            brqm.setImageBitmap(BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + "/" + brqmpic + ".jpg"));
        }
        brqm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivityForResult(new Intent(con, WriteActivity.class)
                        .putExtra("cardnum", obj.getCARDNUM())
                        .putExtra("tabId", null==obj.getSFJLH()||"".equals(obj.getSFJLH()) ? "noid" : obj.getSFJLH())
                        .putExtra("tabType", "zxjsbsf")
                        .putExtra("imageType", "img")
                        .putExtra("class", "jsjb_sfjl.class"), 9);
            }
        });
        xcqm = (ImageView) findViewById(R.id.xcqm);
        if (obj != null && !StringUtils.isEmpty(obj.getXcqm())) {
            xcqmpic = obj.getXcqm();
            xcqm.setImageBitmap(BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + "/" + xcqmpic + ".jpg"));
        }
        xcqm.setOnClickListener(new CustomerListener());
        //现场拍照
        xcpaizhao = (ImageView) findViewById(R.id.xcpaizhao);
        xcpaizhao.setOnClickListener(new CustomerListener());
        //现场拍照照片id
        pz_record_id = (TextView) findViewById(R.id.pz_record_id);
        if(obj != null && !StringUtils.isEmpty(obj.getImg2())) {
            //fjhdycrhsf/D24E75C5BB5E417EBE65494CA09BF399.jpg
            String[] img2Arr =obj.getImg2().split("/");
            if(null !=img2Arr && img2Arr.length>1){
                pz_record_id.setText(img2Arr[1]);
            }
        }
        jmqm_record_id= (TextView) findViewById(R.id.jmqm_record_id);
        if(obj != null && !StringUtils.isEmpty(obj.getImg())) {
            String[] img2Arr =obj.getImg().split("/");
            if(null !=img2Arr && img2Arr.length>1){
                jmqm_record_id.setText(img2Arr[1]);
            }
        }
        ysqm_record_id= (TextView) findViewById(R.id.ysqm_record_id);
        if(obj != null && !StringUtils.isEmpty(obj.getImg1())) {
            //fjhdycrhsf/D24E75C5BB5E417EBE65494CA09BF399.jpg
            String[] img2Arr =obj.getImg1().split("/");
            if(null !=img2Arr && img2Arr.length>1){
                ysqm_record_id.setText(img2Arr[1]);
            }
        }

        //姓名
        XINGMING = (TextView) findViewById(R.id.XINGMING);
        XINGMING.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (!NetWorkUtils.isNetworkConnected(con)) {
                    MyToastUtil.ShowToast(con, "联网失败！");
                }else {
                    Bundle bundle = getIntent().getExtras();
                    if (null != bundle.getString("type") && "add".equals(bundle.getString("type"))) {
                        startActivityForResult(new Intent(con, choose_user.class).putExtra("cname", "jsjb_sfjl.class"), 1);
                    }
                }

            }
        });
        back = (LinearLayout) findViewById(R.id.back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if(pzChange){
                   SweetAlertDialogUtil.WarningDialogHaveCancelAndConfirm(con,"你确认不保存数据更新吗？","现场拍照已经采集，请注意点击“保存”","确定", "返回");
                }else {
                    finish();
                }
            }
        });
        title = (TextView) findViewById(R.id.title);
        uname = (TextView) findViewById(R.id.uname);
        title.setText("严重精神障碍患者随访服务记录");
        uname.setText("保存");
        uname.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                boolean validate = BinderUtil.copyDataToViewNew(jsjb_sfjl.this, obj);
                if(!validate){

//                }else if(null == XINGMING.getText().toString() || "".equals(XINGMING.getText().toString())){
//                    SweetAlertDialogUtil.WarningDialog(con, "提示", "姓名不能为空");
//                }else if(null == SFRQ.getText().toString() || "".equals(SFRQ.getText().toString())) {
//                    SweetAlertDialogUtil.WarningDialog(con, "提示", "随访日期不能为空");
//                }else if(null == XCSFRQ.getText().toString() || "".equals(XCSFRQ.getText().toString())) {
//                    SweetAlertDialogUtil.WarningDialog(con, "提示", "下次随访日期不能为空");
//                }else if ("1".equals(SharedPreferencesUtils.getParam(con, "ysqm", "0").toString()) && ysqm_record_id.getText().toString().equals("noid")) {
//                    SweetAlertDialogUtil.WarningDialog(con, "提示", "随访医生签名不能为空");
                }else if ("1".equals(SharedPreferencesUtils.getParam(con, "jmqm", "0").toString()) && jmqm_record_id.getText().toString().equals("noid")) {
                    SweetAlertDialogUtil.WarningDialog(con, "提示", "家属或本人签名不能为空");
                }else if ("1".equals(SharedPreferencesUtils.getParam(con, "xcpz", "0").toString()) && pz_record_id.getText().toString().equals("noid")) {
                    SweetAlertDialogUtil.WarningDialog(con, "提示", "现场拍照不能为空");
                } else if (NetWorkUtils.isNetworkConnected(con)) {  ///网络连接
                    RequestParams ps = BinderUtil.generateRequestParamsByView(jsjb_sfjl.this);
                    if (isadd) {
                        ps.add("entity.JKDAH", JKDAH);
                        url = HttpUrl.AddJsbSf;
                    } else {
                        ps.add("entity.SFJLH", obj.getSFJLH());
                        ps.add("entity.JKDAH", obj.getJKDAH());
                        url = HttpUrl.EditJsbSf;
                    }
                    ps.add("entity.SFFS", obj.getSFFS());
                    ps.add("entity.SFYY", obj.getSFYY());
                    ps.add("entity.SWYY", obj.getSWYY());
                    ps.add("entity.SWYYQT", obj.getSWYYQT());
                    ps.add("entity.WXX", obj.getWXX());
                    ps.add("entity.ZZL", obj.getZZL());
                    ps.add("entity.SMQK", obj.getSMQK());
                    ps.add("entity.YSQK", obj.getYSQK());
                    ps.add("entity.GRSHLL", obj.getGRSHLL());
                    ps.add("entity.JWLD", obj.getJWLD());
                    ps.add("entity.SCLDGZ", obj.getSCLDGZ());
                    ps.add("entity.XXNL", obj.getXXNL());
                    ps.add("entity.SHRJJW", obj.getSHRJJW());
                    ps.add("entity.GSQK", obj.getGSQK());
                    ps.add("entity.ZYQK", obj.getZYQK());
                    ps.add("entity.SYSJC", obj.getSYSJC());
                    ps.add("entity.FYYCX", obj.getFYYCX());
                    ps.add("entity.ZLXG", obj.getZLXG());
                    ps.add("entity.SFFL", obj.getSFFL());
                    ArrayList<Integer> kfcslist = KFCS.getAllItemSelectedIndex();
                    String kfcss = "";
                    for (int i = 0; i < kfcslist.size(); i++) {
                        if (i == 0)
                            kfcss = (Integer.parseInt(kfcslist.get(i)+"")+1) + "";
                        else
                            kfcss = kfcss + "," + (Integer.parseInt(kfcslist.get(i)+"")+1);
                    }
                    ps.add("entity.KFCS", kfcss);
                    ps.add("entity.TZLXBM", obj.getTZLXBM());
                    ps.add("entity.SFZZ", obj.getSFZZ());
                    ps.add("entity.ZZJG", obj.getZZJG());
                    ps.add("entity.LXJSKYS", obj.getLXJSKYS());
                    ps.add("entity.YWBLFY", obj.getYWBLFY());
                    //既往主要症状
                    ArrayList<Integer> jwslist = ZHENGZHUANG.getAllItemSelectedIndex();
                    String jwss = "";
                    for (int i = 0; i < jwslist.size(); i++) {
                        if (i == 0)
                            jwss = (Integer.parseInt(jwslist.get(i)+"")+1) + "";
                        else
                            jwss = jwss + "," + (Integer.parseInt(jwslist.get(i)+"")+1);
                    }
                    ps.add("entity.ZHENGZHUANG", jwss);
                    ps.add("entity.CARDNUM", obj.getCARDNUM());
                    ps.add("token", SharedPreferencesUtils.getParam(con, "token", "").toString());
                    ps.add("type", "2");

                    ps.add("pz_record_id", pz_record_id.getText().toString());
                    ps.add("jmqm_record_id", jmqm_record_id.getText().toString());
                    ps.add("ysqm_record_id", jmqm_record_id.getText().toString());
                    ps.add("entity.UPDATETIME", obj.getUPDATETIME());
                    //jsjb_sfjl.super.ImageUploadOperate(sfysqmpic, brqmpic, ps);
                    UserClient.get(url, ps, new AsyncHttpResponseHandler() {
                        @Override
                        public void onSuccess(int statusCode, Header[] headers, byte[] response) {
                            String content = new String(response);
                            RetMsg ret = JSON.parseObject(content, RetMsg.class);
                            if (ret.getCode().equals("200")) {
                                MyToastUtil.ShowToast(con, "成功");
                            }else{
                                MyToastUtil.ShowToast(con, ret.getInfo());
                            }
                            finish();
                        }

                        @Override
                        public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {

                            MyToastUtil.ShowToast(con, "失败");
                        }
                    });
                } else {

                }

            }
        });


        //随访日期
        SFRQ =(TextView)findViewById(R.id.SFRQ);
        if(obj != null && !StringUtils.isEmpty(obj.getSFRQ())){
            SFRQ.setText(DateConvert.dateToString(DateConvert.toDate(obj.getSFRQ(), DateConvert.YMD), DateConvert.YMD)+"    ");
        }
        SFRQ.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.CHINA);
                String now = sdf.format(new Date());
                customDatePicker = new CustomDatePicker(con, new CustomDatePicker.ResultHandler() {
                    @Override
                    public void handle(String time) { // 回调接口，获得选中的时间
                        SFRQ.setText(time.split(" ")[0]);
                    }
                }, "2010-01-01 00:00", now); // 初始化日期格式请用：yyyy-MM-dd HH:mm，否则不能正常运行
                customDatePicker.showSpecificTime(false); // 不显示时和分
                customDatePicker.setIsLoop(false); // 不允许循环滚动
                customDatePicker.show(now);
            }
        });
        //死亡日期SWRQ
        SWRQ = (TextView) findViewById(R.id.SWRQ);
        if(obj != null && !StringUtils.isEmpty(obj.getSWRQ())){
            SWRQ.setText(DateConvert.dateToString(DateConvert.toDate(obj.getSWRQ(), DateConvert.YMD), DateConvert.YMD)+"    ");
        }
        SWRQ.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.CHINA);
                String now = sdf.format(new Date());
                customDatePicker = new CustomDatePicker(con, new CustomDatePicker.ResultHandler() {
                    @Override
                    public void handle(String time) { // 回调接口，获得选中的时间
                        SWRQ.setText(time.split(" ")[0]);
                    }
                }, "2010-01-01 00:00", now); // 初始化日期格式请用：yyyy-MM-dd HH:mm，否则不能正常运行
                customDatePicker.showSpecificTime(false); // 不显示时和分
                customDatePicker.setIsLoop(false); // 不允许循环滚动
                customDatePicker.show(now);
            }
        });

        //轻度滋事
        QDZS= (EditText) findViewById(R.id.QDZS);
        if (obj != null && !StringUtils.isEmpty(obj.getQDZS())) {
            QDZS.setText(obj.getQDZS());
        }
        //肇事
        ZHAOSHI= (EditText) findViewById(R.id.ZHAOSHI);
        if (obj != null && !StringUtils.isEmpty(obj.getZHAOSHI())) {
            ZHAOSHI.setText(obj.getZHAOSHI());
        }
        //肇祸
        ZHAOHUO= (EditText) findViewById(R.id.ZHAOHUO);
        if (obj != null && !StringUtils.isEmpty(obj.getZHAOHUO())) {
            ZHAOHUO.setText(obj.getZHAOHUO());
        }
        //其他危害行为
        QTWHXW= (EditText) findViewById(R.id.QTWHXW);
        if (obj != null && !StringUtils.isEmpty(obj.getQTWHXW())) {
            QTWHXW.setText(obj.getQTWHXW());
        }
        //自伤
        ZISHANG= (EditText) findViewById(R.id.ZISHANG);
        if (obj != null && !StringUtils.isEmpty(obj.getZISHANG())) {
            ZISHANG.setText(obj.getZISHANG());
        }
        //自杀未遂
        ZISHAWS= (EditText) findViewById(R.id.ZISHAWS);
        if (obj != null && !StringUtils.isEmpty(obj.getZISHAWS())) {
            ZISHAWS.setText(obj.getZISHAWS());
        }
        //目次出院时间
        MCCYRQ= (TextView) findViewById(R.id.MCCYRQ);
        if(obj != null && !StringUtils.isEmpty(obj.getMCCYRQ())){
            MCCYRQ.setText(DateConvert.dateToString(DateConvert.toDate(obj.getMCCYRQ(), DateConvert.YMD), DateConvert.YMD)+"    ");
        }
        MCCYRQ.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.CHINA);
                String now = sdf.format(new Date());
                customDatePicker = new CustomDatePicker(con, new CustomDatePicker.ResultHandler() {
                    @Override
                    public void handle(String time) { // 回调接口，获得选中的时间
                        MCCYRQ.setText(time.split(" ")[0]);
                    }
                }, "2010-01-01 00:00", now); // 初始化日期格式请用：yyyy-MM-dd HH:mm，否则不能正常运行
                customDatePicker.showSpecificTime(false); // 不显示时和分
                customDatePicker.setIsLoop(false); // 不允许循环滚动
                customDatePicker.show(now);
            }
        });


        //目前用药情况-药物1
        YWMC1= (EditText) findViewById(R.id.YWMC1);
        if (obj != null && !StringUtils.isEmpty(obj.getYWMC1())) {
            YWMC1.setText(obj.getYWMC1());
        }
        //目前用药情况-用法1
        YWYF1 = (EditText) findViewById(R.id.YWYF1);
        if (obj != null && !StringUtils.isEmpty(obj.getYWYF1())) {
            YWYF1.setText(obj.getYWYF1());
        }
        //目前用药情况-用量1
        YWYL1 = (EditText) findViewById(R.id.YWYL1);
        if (obj != null && !StringUtils.isEmpty(obj.getYWYL1())) {
            YWYL1.setText(obj.getYWYL1());
        }
        //
        YWDW1 = (EditText) findViewById(R.id.YWDW1);
        if (obj != null && !StringUtils.isEmpty(obj.getYWDW1())) {
            YWDW1.setText(obj.getYWDW1());
        }

        //目前用药情况-药物2
        YWMC2= (EditText) findViewById(R.id.YWMC2);
        if (obj != null && !StringUtils.isEmpty(obj.getYWMC2())) {
            YWMC2.setText(obj.getYWMC2());
        }
        //目前用药情况-用法1
        YWYF2 = (EditText) findViewById(R.id.YWYF2);
        if (obj != null && !StringUtils.isEmpty(obj.getYWYF2())) {
            YWYF2.setText(obj.getYWYF2());
        }
        //目前用药情况-用量2
        YWYL2 = (EditText) findViewById(R.id.YWYL2);
        if (obj != null && !StringUtils.isEmpty(obj.getYWYL2())) {
            YWYL2.setText(obj.getYWYL2());
        }
        //
        YWDW2 = (EditText) findViewById(R.id.YWDW2);
        if (obj != null && !StringUtils.isEmpty(obj.getYWDW2())) {
            YWDW2.setText(obj.getYWDW2());
        }

        //目前用药情况-药物3
        YWMC3= (EditText) findViewById(R.id.YWMC3);
        if (obj != null && !StringUtils.isEmpty(obj.getYWMC3())) {
            YWMC3.setText(obj.getYWMC3());
        }
        //目前用药情况-用法1
        YWYF3 = (EditText) findViewById(R.id.YWYF3);
        if (obj != null && !StringUtils.isEmpty(obj.getYWYF3())) {
            YWYF3.setText(obj.getYWYF3());
        }
        //目前用药情况-用量3
        YWYL3 = (EditText) findViewById(R.id.YWYL3);
        if (obj != null && !StringUtils.isEmpty(obj.getYWYL3())) {
            YWYL3.setText(obj.getYWYL3());
        }
        //
        YWDW3 = (EditText) findViewById(R.id.YWDW3);
        if (obj != null && !StringUtils.isEmpty(obj.getYWDW3())) {
            YWDW3.setText(obj.getYWDW3());
        }



        //调整目前用药情况-药物1
        TZYWMC1= (EditText) findViewById(R.id.TZYWMC1);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWMC1())) {
            TZYWMC1.setText(obj.getTZYWMC1());
        }
        //调整目前用药情况-用法1
        TZYWYF1 = (EditText) findViewById(R.id.TZYWYF1);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWYF1())) {
            TZYWYF1.setText(obj.getTZYWYF1());
        }
        //调整目前用药情况-用量1
        TZYWYL1 = (EditText) findViewById(R.id.TZYWYL1);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWYL1())) {
            TZYWYL1.setText(obj.getTZYWYL1());
        }
        //调整
        TZYWDW1 = (EditText) findViewById(R.id.TZYWDW1);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWDW1())) {
            TZYWDW1.setText(obj.getTZYWDW1());
        }

        //调整目前用药情况-药物2
        TZYWMC2= (EditText) findViewById(R.id.TZYWMC2);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWMC2())) {
            TZYWMC2.setText(obj.getTZYWMC2());
        }
        //调整目前用药情况-用法1
        TZYWYF2 = (EditText) findViewById(R.id.TZYWYF2);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWYF2())) {
            TZYWYF2.setText(obj.getTZYWYF2());
        }
        //调整目前用药情况-用量2
        TZYWYL2 = (EditText) findViewById(R.id.TZYWYL2);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWYL2())) {
            TZYWYL2.setText(obj.getTZYWYL2());
        }
        //调整
        TZYWDW2 = (EditText) findViewById(R.id.TZYWDW2);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWDW2())) {
            TZYWDW2.setText(obj.getTZYWDW2());
        }

        //调整目前用药情况-药物3
        TZYWMC3= (EditText) findViewById(R.id.TZYWMC3);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWMC3())) {
            TZYWMC3.setText(obj.getTZYWMC3());
        }
        //调整目前用药情况-用法1
        TZYWYF3 = (EditText) findViewById(R.id.TZYWYF3);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWYF3())) {
            TZYWYF3.setText(obj.getTZYWYF3());
        }
        //调整目前用药情况-用量3
        TZYWYL3 = (EditText) findViewById(R.id.TZYWYL3);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWYL3())) {
            TZYWYL3.setText(obj.getTZYWYL3());
        }
        //调整
        TZYWDW3 = (EditText) findViewById(R.id.TZYWDW3);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWDW3())) {
            TZYWDW3.setText(obj.getTZYWDW3());
        }

        //药物不良反应-选择“有”时填写内容
        YWBLFYY= (EditText) findViewById(R.id.YWBLFYY);
        if (obj != null && !StringUtils.isEmpty(obj.getYWBLFYY())) {
            YWBLFYY.setText(obj.getYWBLFYY());
        }
        //公安部门/社区综治中心受理人姓名、电话
        SLRXM1= (EditText) findViewById(R.id.SLRXM1);
        if (obj != null && !StringUtils.isEmpty(obj.getSLRXM1())) {
            SLRXM1.setText(obj.getSLRXM1());
        }
        SLRXM2= (EditText) findViewById(R.id.SLRXM2);
        if (obj != null && !StringUtils.isEmpty(obj.getSLRXM2())) {
            SLRXM2.setText(obj.getSLRXM2());
        }
        SLRDH1= (EditText) findViewById(R.id.SLRDH1);
        if (obj != null && !StringUtils.isEmpty(obj.getSLRDH1())) {
            SLRDH1.setText(obj.getSLRDH1());
        }
        SLRDH2= (EditText) findViewById(R.id.SLRDH2);
        if (obj != null && !StringUtils.isEmpty(obj.getSLRDH2())) {
            SLRDH2.setText(obj.getSLRDH2());
        }
        //转诊原因
        ZZYY= (EditText) findViewById(R.id.ZZYY);
        if (obj != null && !StringUtils.isEmpty(obj.getZZYY())) {
            ZZYY.setText(obj.getZZYY());
        }
        //转诊机构及科室
        ZZJGJKB= (EditText) findViewById(R.id.ZZJGJKB);
        if (obj != null && !StringUtils.isEmpty(obj.getZZJGJKB())) {
            ZZJGJKB.setText(obj.getZZJGJKB());
        }
        //转诊联系人
        ZZLXR= (EditText) findViewById(R.id.ZZLXR);
        if (obj != null && !StringUtils.isEmpty(obj.getZZLXR())) {
            ZZLXR.setText(obj.getZZLXR());
        }
        //转诊联系方式
        ZZLXFS= (EditText) findViewById(R.id.ZZLXFS);
        if (obj != null && !StringUtils.isEmpty(obj.getZZLXFS())) {
            ZZLXFS.setText(obj.getZZLXFS());
        }
        //精神专科医师姓名
        JSKYSXM= (EditText) findViewById(R.id.JSKYSXM);
        if (obj != null && !StringUtils.isEmpty(obj.getJSKYSXM())) {
            JSKYSXM.setText(obj.getJSKYSXM());
        }
        //精神专科医师电话
        JSKYSDH= (EditText) findViewById(R.id.JSKYSDH);
        if (obj != null && !StringUtils.isEmpty(obj.getJSKYSDH())) {
            JSKYSDH.setText(obj.getJSKYSDH());
        }
        //处置结果
        CZJG= (EditText) findViewById(R.id.CZJG);
        if (obj != null && !StringUtils.isEmpty(obj.getCZJG())) {
            CZJG.setText(obj.getCZJG());
        }


        //下次随访日期
        XCSFRQ= (TextView) findViewById(R.id.XCSFRQ);
        if(obj != null && !StringUtils.isEmpty(obj.getXCSFRQ())){
            XCSFRQ.setText(DateConvert.dateToString(DateConvert.toDate(obj.getXCSFRQ(), DateConvert.YMD), DateConvert.YMD)+"    ");
        }
        XCSFRQ.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.CHINA);
                customDatePicker = new CustomDatePicker(con, new CustomDatePicker.ResultHandler() {
                    @Override
                    public void handle(String time) { // 回调接口，获得选中的时间
                        XCSFRQ.setText(time.split(" ")[0]);
                    }
                }, DateConvert.getCustomDatePickerStartRq(), DateConvert.getCustomDatePickerEndRq()); // 初始化日期格式请用：yyyy-MM-dd HH:mm，否则不能正常运行
                customDatePicker.showSpecificTime(false); // 不显示时和分
                customDatePicker.setIsLoop(false); // 不允许循环滚动
                customDatePicker.show(DateConvert.getCustomDatePickerNowRq());
            }
        });
    }

    private void initRadioGroup(final JsbSf obj){
        //随访方式
        SFFS = (RadioGroup)findViewById(R.id.SFFS);
        System.out.println("obj.getSFFS()=================================>"+obj.getSFFS());
        if (obj != null && !StringUtils.isEmpty(obj.getSFFS())) {
            switch (Integer.parseInt(obj.getSFFS())) {
                case 1:
                    SFFS.check(R.id.sffs_mz);
                    break;
                case 2:
                    SFFS.check(R.id.sffs_jt);
                    break;
                case 3:
                    SFFS.check(R.id.sffs_dh);
                    break;
            }
        }
        SFFS.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.sffs_mz)
                    obj.setSFFS("1");
                if (checkedId == R.id.sffs_jt)
                    obj.setSFFS("2");
                if (checkedId == R.id.sffs_dh)
                    obj.setSFFS("3");
            }
        });
        //失访原因
        SFYY = (RadioGroup)findViewById(R.id.SFYY);
        if (obj != null && !StringUtils.isEmpty(obj.getSFYY())) {
            switch (obj.getSFYY()) {
                case "1":
                    SFYY.check(R.id.sfyy1);
                    break;
                case "2":
                    SFYY.check(R.id.sfyy2);
                    break;
                case "3":
                    SFYY.check(R.id.sfyy3);
                    break;
                case "4":
                    SFYY.check(R.id.sfyy4);
                    break;
                case "5":
                    SFYY.check(R.id.sfyy5);
                    break;
            }
        }
        SFYY.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.sfyy1)
                    obj.setSFYY("1");
                if (checkedId == R.id.sfyy2)
                    obj.setSFYY("2");
                if (checkedId == R.id.sfyy3)
                    obj.setSFYY("3");
                if (checkedId == R.id.sfyy4)
                    obj.setSFYY("4");
                if (checkedId == R.id.sfyy5)
                    obj.setSFYY("5");
            }
        });
        //死亡原因
        SWYY= (RadioGroup)findViewById(R.id.SWYY);
        if (obj != null && !StringUtils.isEmpty(obj.getSWYY())) {
            switch (obj.getSWYY()) {
                case "1":
                    SWYY.check(R.id.swyy1);
                    break;
                case "2":
                    SWYY.check(R.id.swyy2);
                    break;
                case "3":
                    SWYY.check(R.id.swyy3);
                    break;
                case "4":
                    SWYY.check(R.id.swyy4);
                    break;
                case "5":
                    SWYY.check(R.id.swyy5);
                    break;
                case "6":
                    SWYY.check(R.id.swyy6);
                    break;
            }
        }
        SWYY.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.swyy1)
                   obj.setSWYY("1");
                if (checkedId == R.id.swyy2)
                   obj.setSWYY("2");
                if (checkedId == R.id.swyy3)
                   obj.setSWYY("3");
                if (checkedId == R.id.swyy4)
                   obj.setSWYY("4");
                if (checkedId == R.id.swyy5)
                   obj.setSWYY("5");
                if (checkedId == R.id.swyy6)
                   obj.setSWYY("6");
            }
        });
        //死亡原因选择“躯体疾病”后选择字典
        SWYYQT= (RadioGroup)findViewById(R.id.SWYYQT);
        if (obj != null && !StringUtils.isEmpty(obj.getSWYYST())) {
            switch (obj.getSWYYST()) {
                case "1":
                    SWYYQT.check(R.id.qtjb1);
                    break;
                case "2":
                    SWYYQT.check(R.id.qtjb2);
                    break;
                case "3":
                    SWYYQT.check(R.id.qtjb3);
                    break;
                case "4":
                    SWYYQT.check(R.id.qtjb4);
                    break;
                case "5":
                    SWYYQT.check(R.id.qtjb5);
                    break;
                case "6":
                    SWYYQT.check(R.id.qtjb6);
                    break;
                case "7":
                    SWYYQT.check(R.id.qtjb7);
                    break;
                case "8":
                    SWYYQT.check(R.id.qtjb8);
                    break;
            }
        }
        SWYYQT.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.qtjb1)
                   obj.setSWYYQT("1");
                if (checkedId == R.id.qtjb2)
                   obj.setSWYYQT("2");
                if (checkedId == R.id.qtjb3)
                   obj.setSWYYQT("3");
                if (checkedId == R.id.qtjb4)
                   obj.setSWYYQT("4");
                if (checkedId == R.id.qtjb5)
                   obj.setSWYYQT("5");
                if (checkedId == R.id.qtjb6)
                   obj.setSWYYQT("6");
                if (checkedId == R.id.qtjb7)
                   obj.setSWYYQT("8");
                if (checkedId == R.id.qtjb8)
                   obj.setSWYYQT("8");
            }
        });
        //危险性评估
        WXX= (RadioGroup)findViewById(R.id.WXX);
        if (obj != null && !StringUtils.isEmpty(obj.getWXX())) {
            switch (Integer.parseInt(obj.getWXX())) {
                case 1:
                    WXX.check(R.id.wxpg1);
                    break;
                case 2:
                    WXX.check(R.id.wxpg2);
                    break;
                case 3:
                    WXX.check(R.id.wxpg3);
                    break;
                case 4:
                    WXX.check(R.id.wxpg4);
                    break;
                case 5:
                    WXX.check(R.id.wxpg5);
                    break;
            }
        }
        WXX.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.wxpg1)
                   obj.setWXX("1");
                if (checkedId == R.id.wxpg2)
                   obj.setWXX("2");
                if (checkedId == R.id.wxpg3)
                   obj.setWXX("3");
                if (checkedId == R.id.wxpg4)
                   obj.setWXX("4");
                if (checkedId == R.id.wxpg5)
                   obj.setWXX("5");
            }
        });
        //自知力
        ZZL = (RadioGroup)findViewById(R.id.ZZL);
        if (obj != null && !StringUtils.isEmpty(obj.getZZL())) {
            switch (Integer.parseInt(obj.getZZL())) {
                case 1:
                    ZZL.check(R.id.zzl1);
                    break;
                case 2:
                    ZZL.check(R.id.zzl2);
                    break;
                case 3:
                    ZZL.check(R.id.zzl3);
                    break;
            }
        }
        ZZL.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.zzl1)
                   obj.setZZL("1");
                if (checkedId == R.id.zzl2)
                   obj.setZZL("2");
                if (checkedId == R.id.zzl3)
                   obj.setZZL("3");
            }
        });
        //睡眠情况
        SMQK = (RadioGroup)findViewById(R.id.SMQK);
        if (obj != null && !StringUtils.isEmpty(obj.getSMQK())) {
            switch (Integer.parseInt(obj.getSMQK())) {
                case 1:
                    SMQK.check(R.id.smqk1);
                    break;
                case 2:
                    SMQK.check(R.id.smqk2);
                    break;
                case 3:
                    SMQK.check(R.id.smqk3);
                    break;
            }
        }
        SMQK.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.smqk1)
                   obj.setSMQK("1");
                if (checkedId == R.id.smqk2)
                   obj.setSMQK("2");
                if (checkedId == R.id.smqk3)
                   obj.setSMQK("3");
            }
        });
        //饮食情况
        YSQK = (RadioGroup)findViewById(R.id.YSQK);
        if (obj != null && !StringUtils.isEmpty(obj.getYSQK())) {
            switch (Integer.parseInt(obj.getYSQK())) {
                case 1:
                    YSQK.check(R.id.ysqk1);
                    break;
                case 2:
                    YSQK.check(R.id.ysqk2);
                    break;
                case 3:
                    YSQK.check(R.id.ysqk3);
                    break;
            }
        }
        YSQK.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.ysqk1)
                   obj.setYSQK("1");
                if (checkedId == R.id.ysqk2)
                   obj.setYSQK("2");
                if (checkedId == R.id.ysqk3)
                   obj.setYSQK("3");
            }
        });

        //个人生活料理
        GRSHLL= (RadioGroup)findViewById(R.id.GRSHLL);
        if (obj != null && !StringUtils.isEmpty(obj.getGRSHLL())) {
            switch (Integer.parseInt(obj.getGRSHLL())) {
                case 1:
                    GRSHLL.check(R.id.ysqk1);
                    break;
                case 2:
                    GRSHLL.check(R.id.ysqk2);
                    break;
                case 3:
                    GRSHLL.check(R.id.ysqk3);
                    break;
            }
        }
        GRSHLL.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.ysqk1)
                   obj.setGRSHLL("1");
                if (checkedId == R.id.ysqk2)
                   obj.setGRSHLL("2");
                if (checkedId == R.id.ysqk3)
                   obj.setGRSHLL("3");
            }
        });
        //家务劳动
        JWLD= (RadioGroup)findViewById(R.id.JWLD);
        if (obj != null && !StringUtils.isEmpty(obj.getJWLD())) {
            switch (Integer.parseInt(obj.getJWLD())) {
                case 1:
                    JWLD.check(R.id.jwld1);
                    break;
                case 2:
                    JWLD.check(R.id.jwld2);
                    break;
                case 3:
                    JWLD.check(R.id.jwld3);
                    break;
            }
        }
        JWLD.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.jwld1)
                   obj.setJWLD("1");
                if (checkedId == R.id.jwld2)
                   obj.setJWLD("2");
                if (checkedId == R.id.jwld3)
                   obj.setJWLD("3");
            }
        });
        //生产劳动及工作
        SCLDGZ= (RadioGroup)findViewById(R.id.SCLDGZ);
        if (obj != null && !StringUtils.isEmpty(obj.getSCLDGZ())) {
            switch (Integer.parseInt(obj.getSCLDGZ())) {
                case 1:
                    SCLDGZ.check(R.id.scldjgz1);
                    break;
                case 2:
                    SCLDGZ.check(R.id.scldjgz2);
                    break;
                case 3:
                    SCLDGZ.check(R.id.scldjgz3);
                    break;
            }
        }
        SCLDGZ.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.scldjgz1)
                   obj.setSCLDGZ("1");
                if (checkedId == R.id.scldjgz2)
                   obj.setSCLDGZ("2");
                if (checkedId == R.id.scldjgz3)
                   obj.setSCLDGZ("3");
            }
        });
        //学习能力
        XXNL= (RadioGroup)findViewById(R.id.XXNL);
        if (obj != null && !StringUtils.isEmpty(obj.getXXNL())) {
            switch (Integer.parseInt(obj.getXXNL())) {
                case 1:
                    XXNL.check(R.id.xxnl1);
                    break;
                case 2:
                    XXNL.check(R.id.xxnl2);
                    break;
                case 3:
                    XXNL.check(R.id.xxnl3);
                    break;
            }
        }
        XXNL.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.xxnl1)
                   obj.setXXNL("1");
                if (checkedId == R.id.xxnl2)
                   obj.setXXNL("2");
                if (checkedId == R.id.xxnl3)
                   obj.setXXNL("3");
            }
        });
        //社会人际交往
        SHRJJW= (RadioGroup)findViewById(R.id.SHRJJW);
        if (obj != null && !StringUtils.isEmpty(obj.getSHRJJW())) {
            switch (Integer.parseInt(obj.getSHRJJW())) {
                case 1:
                    SHRJJW.check(R.id.shrjjw1);
                    break;
                case 2:
                    SHRJJW.check(R.id.shrjjw2);
                    break;
                case 3:
                    SHRJJW.check(R.id.shrjjw3);
                    break;
            }
        }
        SHRJJW.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.shrjjw1)
                   obj.setSHRJJW("1");
                if (checkedId == R.id.shrjjw2)
                   obj.setSHRJJW("2");
                if (checkedId == R.id.shrjjw3)
                   obj.setSHRJJW("3");
            }
        });
        //两次随访期间关锁情况
        GSQK= (RadioGroup)findViewById(R.id.GSQK);
        if (obj != null && !StringUtils.isEmpty(obj.getGSQK())) {
            switch (Integer.parseInt(obj.getGSQK())) {
                case 1:
                    GSQK.check(R.id.sfqjgsqk1);
                    break;
                case 2:
                    GSQK.check(R.id.sfqjgsqk2);
                    break;
                case 3:
                    GSQK.check(R.id.sfqjgsqk3);
                    break;
            }
        }
        GSQK.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.sfqjgsqk1)
                   obj.setGSQK("1");
                if (checkedId == R.id.sfqjgsqk2)
                   obj.setGSQK("2");
                if (checkedId == R.id.sfqjgsqk3)
                   obj.setGSQK("3");
            }
        });
        //两次随访期间住院情况
        ZYQK= (RadioGroup)findViewById(R.id.ZYQK);
        if (obj != null && !StringUtils.isEmpty(obj.getZYQK())) {
            switch (Integer.parseInt(obj.getZYQK())) {
                case 0:
                    ZYQK.check(R.id.lcsfqjzyqk1);
                    break;
                case 1:
                    ZYQK.check(R.id.lcsfqjzyqk2);
                    break;
                case 2:
                    ZYQK.check(R.id.lcsfqjzyqk3);
                    break;
            }
        }
        ZYQK.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.lcsfqjzyqk1)
                   obj.setZYQK("0");
                if (checkedId == R.id.lcsfqjzyqk2)
                   obj.setZYQK("1");
                if (checkedId == R.id.lcsfqjzyqk3)
                   obj.setZYQK("2");
            }
        });
        //实验室检查
        SYSJC= (RadioGroup)findViewById(R.id.SYSJC);
        if (obj != null && !StringUtils.isEmpty(obj.getSYSJC())) {
            switch (obj.getSYSJC()) {
                case "无":
                    SYSJC.check(R.id.sysjc1);
                    break;
                case "有":
                    SYSJC.check(R.id.sysjc2);
                    break;
            }
        }
        SYSJC.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.sysjc1)
                   obj.setSYSJC("无");
                if (checkedId == R.id.sysjc2)
                   obj.setSYSJC("有");
            }
        });

        //用药依从性
        FYYCX= (RadioGroup)findViewById(R.id.FYYCX);
        if (obj != null && !StringUtils.isEmpty(obj.getFYYCX())) {
            switch (Integer.parseInt(obj.getFYYCX())) {
                case 1:
                    FYYCX.check(R.id.yyycx1);
                    break;
                case 2:
                    FYYCX.check(R.id.yyycx2);
                    break;
                case 3:
                    FYYCX.check(R.id.yyycx3);
                    break;
                case 4:
                    FYYCX.check(R.id.yyycx4);
                    break;
            }
        }
        FYYCX.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.yyycx1)
                   obj.setFYYCX("1");
                if (checkedId == R.id.yyycx2)
                   obj.setFYYCX("2");
                if (checkedId == R.id.yyycx3)
                   obj.setFYYCX("3");
                if (checkedId == R.id.yyycx4)
                   obj.setFYYCX("4");
            }
        });
        //药物不良反应
        YWBLFY= (RadioGroup)findViewById(R.id.YWBLFY);
        if (obj != null && !StringUtils.isEmpty(obj.getYWBLFY())) {
            switch (Integer.parseInt(obj.getYWBLFY())) {
                case 1:
                    YWBLFY.check(R.id.ywblfy1);
                    break;
                case 2:
                    YWBLFY.check(R.id.ywblfy2);
                    break;
                case 9:
                    YWBLFY.check(R.id.ywblfy3);
                    break;
            }
        }
        YWBLFY.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.ywblfy1)
                    obj.setYWBLFY("1");
                if (checkedId == R.id.ywblfy2)
                    obj.setYWBLFY("2");
                if (checkedId == R.id.ywblfy3)
                    obj.setYWBLFY("9");
            }
        });
        //治疗效果
        ZLXG= (RadioGroup)findViewById(R.id.ZLXG);
        if (obj != null && !StringUtils.isEmpty(obj.getZLXG())) {
            switch (Integer.parseInt(obj.getZLXG())) {
                case 1:
                    ZLXG.check(R.id.zljg1);
                    break;
                case 2:
                    ZLXG.check(R.id.zljg2);
                    break;
                case 3:
                    ZLXG.check(R.id.zljg3);
                    break;
                case 4:
                    ZLXG.check(R.id.zljg4);
                    break;
                case 9:
                    ZLXG.check(R.id.zljg9);
                    break;
            }
        }
        ZLXG.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.zljg1)
                    obj.setZLXG("1");
                if (checkedId == R.id.zljg2)
                    obj.setZLXG("2");
                if (checkedId == R.id.zljg3)
                    obj.setZLXG("3");
                if (checkedId == R.id.zljg4)
                    obj.setZLXG("4");
                if (checkedId == R.id.zljg9)
                    obj.setZLXG("9");
            }
        });
        //随访方式
        SFFS = (RadioGroup)findViewById(R.id.SFFS);
        if (obj != null && !StringUtils.isEmpty(obj.getSFFS())) {
            switch (Integer.parseInt(obj.getSFFS())) {
                case 1:
                    SFFS.check(R.id.sffs_mz);
                    break;
                case 2:
                    SFFS.check(R.id.sffs_jt);
                    break;
                case 3:
                    SFFS.check(R.id.sffs_dh);
                    break;
            }
        }
        SFFS.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.sffs_mz)
                    obj.setSFFS("1");
                if (checkedId == R.id.sffs_jt)
                    obj.setSFFS("2");
                if (checkedId == R.id.sffs_dh)
                    obj.setSFFS("3");
            }
        });
        //本次随访分类
        SFFL= (RadioGroup)findViewById(R.id.SFFL);
        if (obj != null && !StringUtils.isEmpty(obj.getSFFL())) {
            switch (Integer.parseInt(obj.getSFFL())) {
                case 1:
                    SFFL.check(R.id.bcsffl1);
                    break;
                case 2:
                    SFFL.check(R.id.bcsffl2);
                    break;
                case 3:
                    SFFL.check(R.id.bcsffl3);
                    break;
            }
        }
        SFFL.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.bcsffl1)
                    obj.setSFFL("1");
                if (checkedId == R.id.bcsffl2)
                    obj.setSFFL("2");
                if (checkedId == R.id.bcsffl3)
                    obj.setSFFL("3");
            }
        });
        //通知联席部门
        TZLXBM= (RadioGroup)findViewById(R.id.TZLXBM);
        if (obj != null && !StringUtils.isEmpty(obj.getTZLXBM())) {
            switch (Integer.parseInt(obj.getTZLXBM())) {
                case 1:
                    TZLXBM.check(R.id.tzlxbm1);
                    break;
                case 2:
                    TZLXBM.check(R.id.tzlxbm2);
                    break;
            }
        }
        TZLXBM.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.tzlxbm1)
                    obj.setTZLXBM("1");
                if (checkedId == R.id.tzlxbm2)
                    obj.setTZLXBM("2");
            }
        });
        //是否需要转诊
        SFZZ= (RadioGroup)findViewById(R.id.SFZZ);
        if (obj != null && !StringUtils.isEmpty(obj.getSFZZ())) {
            switch (Integer.parseInt(obj.getSFZZ())) {
                case 1:
                    SFZZ.check(R.id.zz_wu);
                    break;
                case 2:
                    SFZZ.check(R.id.zz_you);
                    break;
            }
        }
        SFZZ.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.zz_wu)
                    obj.setSFZZ("1");
                if (checkedId == R.id.zz_you)
                    obj.setSFZZ("2");
            }
        });
        //转诊是否成功-转诊结果
        ZZJG= (RadioGroup)findViewById(R.id.ZZJG);
        if (obj != null && !StringUtils.isEmpty(obj.getZZJG())) {
            switch (Integer.parseInt(obj.getZZJG())) {
                case 1:
                    ZZJG.check(R.id.zzcg_fou);
                    break;
                case 2:
                    ZZJG.check(R.id.zzcg_shi);
                    break;
            }
        }
        ZZJG.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.zzcg_fou)
                    obj.setZZJG("1");
                if (checkedId == R.id.zzcg_shi)
                    obj.setZZJG("2");
            }
        });
        //联系精神专科医生
        LXJSKYS= (RadioGroup)findViewById(R.id.LXJSKYS);
        if (obj != null && !StringUtils.isEmpty(obj.getLXJSKYS())) {
            switch (Integer.parseInt(obj.getLXJSKYS())) {
                case 1:
                    LXJSKYS.check(R.id.wcg1);
                    break;
                case 2:
                    LXJSKYS.check(R.id.wcg2);
                    break;
            }
        }
        LXJSKYS.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.wcg1)
                    obj.setLXJSKYS("1");
                if (checkedId == R.id.wcg2)
                    obj.setLXJSKYS("2");
            }
        });

        TZYWPL1= (RadioGroup)findViewById(R.id.TZYWPL1);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWPL1())) {
            switch (obj.getTZYWPL1()) {
                case "1":
                    TZYWPL1.check(R.id.TZYWPL11);
                    break;
                case "2":
                    TZYWPL1.check(R.id.TZYWPL12);
                    break;
            }
        }
        TZYWPL1.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.TZYWPL11)
                    obj.setTZYWPL1("1");
                if (checkedId == R.id.TZYWPL12)
                    obj.setTZYWPL1("2");
            }
        });
        TZYWPL2= (RadioGroup)findViewById(R.id.TZYWPL2);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWPL2())) {
            switch (obj.getTZYWPL2()) {
                case "1":
                    TZYWPL2.check(R.id.TZYWPL21);
                    break;
                case "2":
                    TZYWPL2.check(R.id.TZYWPL22);
                    break;
            }
        }
        TZYWPL2.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.TZYWPL21)
                    obj.setTZYWPL2("1");
                if (checkedId == R.id.TZYWPL22)
                    obj.setTZYWPL2("2");
            }
        });
        TZYWPL3= (RadioGroup)findViewById(R.id.TZYWPL3);
        if (obj != null && !StringUtils.isEmpty(obj.getTZYWPL3())) {
            switch (obj.getTZYWPL3()) {
                case "1":
                    TZYWPL3.check(R.id.TZYWPL31);
                    break;
                case "2":
                    TZYWPL3.check(R.id.TZYWPL32);
                    break;
            }
        }
        TZYWPL3.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.TZYWPL31)
                    obj.setTZYWPL3("1");
                if (checkedId == R.id.TZYWPL32)
                    obj.setTZYWPL3("2");
            }
        });



        YWPL1= (RadioGroup)findViewById(R.id.YWPL1);
        if (obj != null && !StringUtils.isEmpty(obj.getYWPL1())) {
            switch (obj.getYWPL1()) {
                case "1":
                    YWPL1.check(R.id.YWPL11);
                    break;
                case "2":
                    YWPL1.check(R.id.YWPL12);
                    break;
            }
        }
        YWPL1.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.YWPL11)
                    obj.setYWPL1("1");
                if (checkedId == R.id.YWPL12)
                    obj.setYWPL1("2");
            }
        });
        YWPL2= (RadioGroup)findViewById(R.id.YWPL2);
        if (obj != null && !StringUtils.isEmpty(obj.getYWPL2())) {
            switch (obj.getYWPL2()) {
                case "1":
                    YWPL2.check(R.id.YWPL21);
                    break;
                case "2":
                    YWPL2.check(R.id.YWPL22);
                    break;
            }
        }
        YWPL2.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.YWPL21)
                    obj.setYWPL2("1");
                if (checkedId == R.id.YWPL22)
                    obj.setYWPL2("2");
            }
        });
        YWPL3= (RadioGroup)findViewById(R.id.YWPL3);
        if (obj != null && !StringUtils.isEmpty(obj.getYWPL3())) {
            switch (obj.getYWPL3()) {
                case "1":
                    YWPL3.check(R.id.YWPL31);
                    break;
                case "2":
                    YWPL3.check(R.id.YWPL32);
                    break;
            }
        }
        YWPL3.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (checkedId == R.id.YWPL31)
                    obj.setYWPL3("1");
                if (checkedId == R.id.YWPL32)
                    obj.setYWPL3("2");
            }
        });
    }

    /***
     * 初始化initMultiLineChooseLayout组件
     */
    private void initMultiLineChooseLayout(){
        //目前症状
        ZHENGZHUANG = (MultiLineChooseLayout) findViewById(R.id.ZHENGZHUANG);
        mqzzdata.add("幻觉");
        mqzzdata.add("交流困难");
        mqzzdata.add("猜疑");
        mqzzdata.add("喜怒无常");
        mqzzdata.add("行为怪异");
        mqzzdata.add("兴奋话多");
        mqzzdata.add("伤人毁物");
        mqzzdata.add("悲观厌世");
        mqzzdata.add("无故外走");
        mqzzdata.add("自语自笑");
        mqzzdata.add("孤僻懒散");
        mqzzdata.add("其他");
        ZHENGZHUANG.setList(mqzzdata);
        if (obj != null && !StringUtils.isEmpty(obj.getZHENGZHUANG())) {
            String[] zzList = obj.getZHENGZHUANG().split(",");
            if (Arrays.asList(zzList).contains("1"))
                ZHENGZHUANG.setIndexItemSelected(0);
            if (Arrays.asList(zzList).contains("2"))
                ZHENGZHUANG.setIndexItemSelected(1);
            if (Arrays.asList(zzList).contains("3"))
                ZHENGZHUANG.setIndexItemSelected(2);
            if (Arrays.asList(zzList).contains("4"))
                ZHENGZHUANG.setIndexItemSelected(3);
            if (Arrays.asList(zzList).contains("5"))
                ZHENGZHUANG.setIndexItemSelected(4);
            if (Arrays.asList(zzList).contains("6"))
                ZHENGZHUANG.setIndexItemSelected(5);
            if (Arrays.asList(zzList).contains("7"))
                ZHENGZHUANG.setIndexItemSelected(6);
            if (Arrays.asList(zzList).contains("8"))
                ZHENGZHUANG.setIndexItemSelected(7);
            if (Arrays.asList(zzList).contains("9"))
                ZHENGZHUANG.setIndexItemSelected(8);
            if (Arrays.asList(zzList).contains("10"))
                ZHENGZHUANG.setIndexItemSelected(9);
            if (Arrays.asList(zzList).contains("11"))
                ZHENGZHUANG.setIndexItemSelected(10);
            if (Arrays.asList(zzList).contains("12"))
                ZHENGZHUANG.setIndexItemSelected(11);
        }

        //康复措施
        KFCS= (MultiLineChooseLayout)findViewById(R.id.KFCS);
        kfcsdata.add("生活劳动能力");
        kfcsdata.add("职业训练");
        kfcsdata.add("学习能力");
        kfcsdata.add("社会交往");
        kfcsdata.add("其他");
        KFCS.setList(kfcsdata);
        if (obj != null && !StringUtils.isEmpty(obj.getKFCS())) {
            String[] zzList = obj.getKFCS().split(",");
            if (Arrays.asList(zzList).contains("1"))
                KFCS.setIndexItemSelected(0);
            if (Arrays.asList(zzList).contains("2"))
                KFCS.setIndexItemSelected(1);
            if (Arrays.asList(zzList).contains("3"))
                KFCS.setIndexItemSelected(2);
            if (Arrays.asList(zzList).contains("4"))
                KFCS.setIndexItemSelected(3);
            if (Arrays.asList(zzList).contains("5"))
                KFCS.setIndexItemSelected(4);
        }
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initListener() {

    }

    class CustomerListener implements View.OnClickListener {
        @Override
        public void onClick(View v) {
            if(obj != null && StringUtils.isEmpty(obj.getJKDAH())) {
                SweetAlertDialogUtil.WarningDialog(con, "提示", "选择居民用户后才能现场拍照");
            }else {
                Intent intent = new Intent(con, CameraChoose.class)
                        .putExtra("type", "edit")
                        .putExtra("cardnum", obj.getCARDNUM())
                        .putExtra("tabId", null==obj.getSFJLH()||"".equals(obj.getSFJLH()) ? "noid" : obj.getSFJLH())
                        .putExtra("tabType", "zxjsbsf")
                        .putExtra("class", "jsjb_sfjl.class");
                startActivityForResult(intent, 119);
            }
        }
    }
}
